if(window.plus) {
	plusReady();
} else {
	document.addEventListener("plusready", onPlusReady, false);

	function onPlusReady() {
		var wv = plus.webview.currentWebview();
		Did = wv.did; //上个页面传过来的值
		alert(Did);
		console.log(JSON.stringify(wv));
		$.ajax({
			type: "post",
			url: webRoot + "?s=/App/Driver/getDriverInfo",
			data: {
				id: Did,
			},
			success: function(d) {

				var data = $.parseJSON(d);
				var driverInfo = data.data.driver;
				var driverComment = data.data.comment;
				var lengths=driverComment.length;
				var star=5;
				console.log(JSON.stringify(driverComment));
				
				var htmlDriverInfo = "";
				htmlDriverInfo = "<div class='banner bg_pic p_tb20_lr30 mui-clearfix'>" +
					"<a class='mui-pull-left'><img src='" + driverInfo.photo + "'class='user_pic circle60'/></a>" +
					"<div class='mui-pull-left w70 color_white p_l10'>" +
					"<span>" + driverInfo.username + "</span>" +
					"<p class='font12 color_white'>80后 • 其他行业 • 深圳 • 设计师 美女 • 爱旅行 • 喜欢听歌看电影</p>" +
					"</div>" +
					"</div>" +
					"<ul class='bg_white b_t1 b_b1'>" +
					"<li class='p_lr15 p_tb16 b_b1'>" +
					"<h4>代驾（" + driverInfo.countorders + "次）</h4>" +
					"</li>" +
					"<li class='mui-text-center p_tb16'>" +
					"<div class='store-star'>" +
					"<span>评价</span>" +
					"<div class='star-outer'>" +
					"<div class='star-inner' data-level='" +star+
					"'></div>" +
					"</div>" +
					"</div>" +
					"</li>" +
					"</ul>";
					$(".driverInfo").html(htmlDriverInfo);
				var htmlDriverComment = "";
				for(var i = 0; i < lengths; i++) {
					htmlDriverComment +=" <ul class='mui-table-view'>"+
						"<li class='mui-table-view-cell'>" +
						"<div class='mui-clearfix'>" +
						"<img src='"+driverComment[i].photo+"' class='circle40 vertical_middle m_r10'/>" +
						" <span>"+driverComment[i].nickname+"</span>" +
						" <p class='font12 mui-pull-right m_t10'>" + driverComment[i].createtime+ "</p>" +
						"</div>" +
						"<div class='font14 p_tb10 p_l50'>" +driverComment[i].thought+ "</div>" +
						" </li><ul/>";
				}
				$(".mui-table-view").html(htmlDriverComment);
				
				
			}
		});

	}
}